package com.smartpro.mis.modular.business.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.plugins.pagination.Pagination;
import com.smartpro.mis.modular.system.model.Orders;
import com.smartpro.mis.modular.system.dao.OrdersMapper;
import com.smartpro.mis.modular.business.service.IOrdersService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 订单 服务实现类
 * </p>
 *
 * @author mengiy123
 * @since 2019-05-07
 */
@Service
public class OrdersServiceImpl extends ServiceImpl<OrdersMapper, Orders> implements IOrdersService {

    @Override
    public List<Orders> selectOrdersList(String startTime, String endTime, int start, int num) {
        return this.baseMapper.selectOrdersList(startTime,endTime,start,num);
    }

    @Override
    public List<Orders> getOrdersListByCompany(String startTime, String endTime, String belongToCompany, int start, int num) {
        return this.baseMapper.getOrdersListByCompany(startTime,endTime,belongToCompany,start,num);
    }


    @Override
    public List<Orders> getMyDistributorOrderList(int distributorID) {
        return this.baseMapper.getMyDistributorOrderList( distributorID);
    }
    @Override
    public List<Orders> selectListByPage(int start, int num) {
        // pageNum是页码，pageSize是该页码内包含的记录数
        Page pageBean = new Page<Orders>(start, num);
        List<Orders> orders = baseMapper.selectListByPage(pageBean,start,num);

        return orders;
    }
}
